/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：spectrumdefine.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/07
 * 摘要：图谱数据定义
 * 当前版本：1.0
 */

#pragma once

#include <QString>
#include "dataspecification_def.h"

namespace DataSpecificationGW
{
    struct SpectrumHead
    {
        SpectrumTypeCode eSpectrumTypeCode;
        qint32 iSpectrumDataLength;
        QString qstrSpectrumGenerationTime;
        SpectrumCharacter eSpectrumCharacter;
        QString qstrEquipmentName;
        QString qstrEquipmentCode;
        QString qstrTestPointName;
        QString qstrTestPointCode;
        qint16 sDetectionChannelID;
        StorageDataType eStorageDataType;

        SpectrumHead()
        {
            eSpectrumTypeCode = SPECTRUM_CODE_MULTI;
            iSpectrumDataLength = 0;
            eSpectrumCharacter = PROPERTY_TEST;
            sDetectionChannelID = 0;
            eStorageDataType = DATA_TYPE_DEFAULT;
        }

        SpectrumHead& operator=(const SpectrumHead& stSpectrumHead)
        {
            this->eSpectrumTypeCode = stSpectrumHead.eSpectrumTypeCode;
            this->iSpectrumDataLength = stSpectrumHead.iSpectrumDataLength;
            this->qstrSpectrumGenerationTime = stSpectrumHead.qstrSpectrumGenerationTime;
            this->eSpectrumCharacter = stSpectrumHead.eSpectrumCharacter;
            this->qstrEquipmentName = stSpectrumHead.qstrEquipmentName;
            this->qstrEquipmentCode = stSpectrumHead.qstrEquipmentCode;
            this->qstrTestPointName = stSpectrumHead.qstrTestPointName;
            this->qstrTestPointCode = stSpectrumHead.qstrTestPointCode;
            this->sDetectionChannelID = stSpectrumHead.sDetectionChannelID;
            this->eStorageDataType = stSpectrumHead.eStorageDataType;
            return *this;
        }

        bool operator==(const SpectrumHead& stSpectrumHead) const
        {
            if (!(this->eSpectrumTypeCode == stSpectrumHead.eSpectrumTypeCode)) return false;
            if (!(this->iSpectrumDataLength == stSpectrumHead.iSpectrumDataLength)) return false;
            if (!(this->qstrSpectrumGenerationTime == stSpectrumHead.qstrSpectrumGenerationTime)) return false;
            if (!(this->eSpectrumCharacter == stSpectrumHead.eSpectrumCharacter)) return false;
            if (!(this->qstrEquipmentName == stSpectrumHead.qstrEquipmentName)) return false;
            if (!(this->qstrEquipmentCode == stSpectrumHead.qstrEquipmentCode)) return false;
            if (!(this->qstrTestPointName == stSpectrumHead.qstrTestPointName)) return false;
            if (!(this->qstrTestPointCode == stSpectrumHead.qstrTestPointCode)) return false;
            if (!(this->sDetectionChannelID == stSpectrumHead.sDetectionChannelID)) return false;
            if (!(this->eStorageDataType == stSpectrumHead.eStorageDataType)) return false;
            return true;
        }
    };
}
